// ignore_for_file: constant_identifier_names

import 'package:dio/dio.dart';

///
/// 请求类型
///
enum XMethod {
  get('GET'),
  post('POST');

  const XMethod(this.value);

  final String value;
}

///
/// 自定义 Dio 异常
///
class XDioException extends DioException {
  XDioException({
    required super.requestOptions,
    super.response,
    super.message,
  });

  factory XDioException.fromDioError(DioException dioError) {
    return XDioException(
      requestOptions: dioError.requestOptions,
      response: dioError.response,
      message: dioError.message,
    );
  }
}
